< previous page page_111 next page >

Page 111
HelpContextID. This property sets a context ID that can be used in conjunction with a custom help file to provide context-sensitive help for your application.
NegotiatePosition. If your application has linked or embedded objects, this property determines if and how this menu item is displayed while the linked or embedded object is active.
Checked. If this property is True, a check mark appears to the left of the menu item's caption to indicate, for example, that a user has selected a particular option. If this property is False, no check mark appears.
Enabled. This property can be set to False if its associated action isn't appropriate at a particular time. For example, if no text is selected, an Edit menu's Copy command can be disabled by setting its Enabled property to False.
Visible. This property determines whether the menu item can be seen. Your application may have menu items that should not be seen at certain times; for example, you may not want the users to be able to see the Window menu item if no windows are open.
WindowList. If your menu is on an MDI (Multiple Document Interface) form, , setting this property for a top-level menu control appends a dynamically-updated list of any active MDI child windows to the menu automatically.
Creating a Simple Menu System
To illustrate the process of designing menus, you actually create a simple menu system now. You'll create a menu structure that includes some standard menu items. First, create a sample File menu:
1. Start Visual Basic, if necessary, and begin a Standard EXE project.
2. Make sure that the form for which you want to create the menu system is selected. Form1 should already be selected; if not, click it.
3. Start the Menu Editor by selecting Tools, Menu Editor, or clicking the Menu Editor button on the toolbar.
The cursor should be in the Caption field. In this field, you enter the text to be displayed by the menu item.
4. Type &File (remember, the ampersand indicates that the next characterF, in this caseis to be the access key). As you type, notice that the caption you are typing automatically appears in the box at the bottom of the Menu Editor. In this area, you can preview the layout of your menu. Note also that the top line of this box is highlighted.
5. Tab to the Name field and type mnuFile.
The two properties you just setCaption and Nameare all you need to set for now. The default values of the other properties work fine.
6. Click Next or press Enter to accept the properties you've set up for this Menu control. The property boxes are then cleared to prepare for a new control. Note that the highlight in the box at the bottom moves down to a new (blank) line.
7. Repeat steps 4 through 6 to create a second menu item. Use &New for the caption and mnuFileNew for the name.

 
< previous page page_111 next page >